package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMplstpRouteGraphMapper;
import com.ruoyi.net.domain.BusiMplstpRouteGraph;
import com.ruoyi.net.service.IBusiMplstpRouteGraphService;

/**
 * mplstp业务路由图Service业务层处理
 * 
 * @author net
 * @date 2024-12-02
 */
@Service
public class BusiMplstpRouteGraphServiceImpl implements IBusiMplstpRouteGraphService 
{
    @Autowired
    private BusiMplstpRouteGraphMapper busiMplstpRouteGraphMapper;

    /**
     * 查询mplstp业务路由图
     * 
     * @param id mplstp业务路由图主键
     * @return mplstp业务路由图
     */
    @Override
    public BusiMplstpRouteGraph selectBusiMplstpRouteGraphById(String id)
    {
        return busiMplstpRouteGraphMapper.selectBusiMplstpRouteGraphById(id);
    }

    /**
     * 查询mplstp业务路由图列表
     * 
     * @param busiMplstpRouteGraph mplstp业务路由图
     * @return mplstp业务路由图
     */
    @Override
    public List<BusiMplstpRouteGraph> selectBusiMplstpRouteGraphList(BusiMplstpRouteGraph busiMplstpRouteGraph)
    {
        return busiMplstpRouteGraphMapper.selectBusiMplstpRouteGraphList(busiMplstpRouteGraph);
    }

    /**
     * 新增mplstp业务路由图
     * 
     * @param busiMplstpRouteGraph mplstp业务路由图
     * @return 结果
     */
    @Override
    public int insertBusiMplstpRouteGraph(BusiMplstpRouteGraph busiMplstpRouteGraph)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMplstpRouteGraph.getId())) {
            busiMplstpRouteGraph.setId(uuid);
        }
        busiMplstpRouteGraph.setCreateBy(SecurityUtils.getUsername());
        busiMplstpRouteGraph.setCreateTime(DateUtils.getNowDate());
        busiMplstpRouteGraph.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRouteGraph.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteGraphMapper.insertBusiMplstpRouteGraph(busiMplstpRouteGraph);
    }

    /**
     * 修改mplstp业务路由图
     * 
     * @param busiMplstpRouteGraph mplstp业务路由图
     * @return 结果
     */
    @Override
    public int updateBusiMplstpRouteGraph(BusiMplstpRouteGraph busiMplstpRouteGraph)
    {
        busiMplstpRouteGraph.setUpdateBy(SecurityUtils.getUsername());
        busiMplstpRouteGraph.setUpdateTime(DateUtils.getNowDate());
        return busiMplstpRouteGraphMapper.updateBusiMplstpRouteGraph(busiMplstpRouteGraph);
    }

    /**
     * 批量删除mplstp业务路由图
     * 
     * @param ids 需要删除的mplstp业务路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteGraphByIds(String[] ids)
    {
        return busiMplstpRouteGraphMapper.deleteBusiMplstpRouteGraphByIds(ids);
    }

    /**
     * 删除mplstp业务路由图信息
     * 
     * @param id mplstp业务路由图主键
     * @return 结果
     */
    @Override
    public int deleteBusiMplstpRouteGraphById(String id)
    {
        return busiMplstpRouteGraphMapper.deleteBusiMplstpRouteGraphById(id);
    }
}
